﻿using SUNRPA.CONTROLS.IMPL.domain.attrubutes;
using SUNRPA.CONTROLS.IMPL.domain.constant;
using SUNRPA.CONTROLS.IMPL.domain.flowRunningVar;
using SUNRPA.CONTROLS.IMPL.util;
using System.Collections.Concurrent;
using System.Text;

namespace SUNRPA.CONTROLS.IMPL.domain.flowItemParam {
    [Serializable]
    [VarFieldName("OutVarName")]
    public class GetDateNParam:BaseParam {
        private int dateType = 0;
        private DateTime pickDate = DateTime.Now;
        private string outVarName = "Date";

        public string GetTranslateDateType() {
            switch(this.DateType) {
                case 0:
                    return "当前时间";
                case 1:
                    return $"时间{pickDate.ToLongDateString()}";
                default : return "当前时间";
            }
        }
        public int DateType {
            get => dateType; 
            set { 
                dateType = value;
                NotifyPropertyChanged("DateType");
            }  
        }
        public DateTime PickDate {
            get => pickDate; 
            set { 
                pickDate = value;
                NotifyPropertyChanged("PickDate");
            }  
        }
        public string OutVarName {
            get => outVarName; 
            set { 
                outVarName = value;
                NotifyPropertyChanged("OutVarName");
            }  
        }
        public override void SetLatestVarName(ConcurrentDictionary<string, ConcurrentDictionary<string, RPAVariableDefineWrapper>> globleData) {
            this.outVarName = this.GetLatestName(this.outVarName, globleData);
        }
    }
}
